Dance Dance RevolutionTime Limit: the MsMemory Limit: 0 Kb64bit IO Format: %lld %llu Submit Status DescriptionMr White, a fat man, and now are crazy about a game named "Dance, Dance, Revolution". But his dance skill was so poor
Title: There are 4 positions, each moving from one position to another requires a specific cost, the minimum cost of a sequence of specified sequences. Only one foot at a time can move, or move and step down.Use D[i][j][u] to indicate that the first I position is complete and the minimum cost in the state (J,u), (J,u) One of which must be equal to A[i], assuming J and A[i] are equal, then either the previous state is (j,u), or the previous state is (k,u), note that the previous state cannot be (
physical strength required when the status is (j, k)It is not difficult to introduce the transfer equation:
Assuming that the current step is in s, all the statuses that match this step are:F (I, 0 .. 4, s), f (I, s, 0... 4)
Then we can roll out the minimum physical call fees for the next step based on the above status.
Assume that the next step is next.
So
If f (I, j, s), (0 The next status is available.F (I + 1, j, s) = f (I, j, k) + 1; // stopF (I + 1, next, s) = min {f (I, j, s) + consume (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.